package util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * \* User: MeiZhongHao
 * \* Date: 2018-11-15
 * \* Time: 17:17
 * \* Description:
 * \
 */
public class ThreadPoolUtil {
    public static ExecutorService pool = Executors.newCachedThreadPool();

    public static void submit(Object target, String methodName, Object... args) {
        pool.submit(new Runnable() {
            @Override
            public void run() {
                try {
                    ReflectionUtil.methodInvoker(target, methodName, args);
                    System.out.println(methodName);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, "tools-default-pool");
    }

}